//
//  CMISQueryDownload.m
//  Alfresco
//
//  Created by Michael Muller on 10/29/09.
//  Copyright 2009 Michael J Muller. All rights reserved.
//

#import "CMISQueryDownload.h"
#import "SearchResult.h"
#import "Utility.h"

#define kMaxSearchResults 30

@implementation CMISQueryDownload

@synthesize results;
@synthesize currentCMISProperty;
@synthesize elementBeingParsed;
@synthesize postData;

- (void) dealloc {
	[results release];
	[elementBeingParsed release];
	[postData release];
	[super dealloc];
}

- (CMISQueryDownload *) initWithQuery:(NSString *)cql delegate: (id <AsynchronousDownloadDelegate>) del {
	
	NSString *h = userPrefHostname();
	NSString *p = userPrefPort();
	NSString *w = userPrefWebApp();
	NSString *protocol = userPrefProtocol();
	
	NSString *urlStr = [[NSString alloc] initWithFormat:@"%@://%@:%@%@/service/api/query", protocol, h, p, w];
	NSURL *u = [NSURL URLWithString:urlStr];
	[urlStr release];
	
	// NOTE: not using namespaces.  they're shifting.  
	// the namespace that works for enterprise 3.1 doesn't work for labs 3.2
	
	// ALSO NOTE: pageSize is not a documented parameter, but 
	// it's required, and it must be non-zero if you want to get any results.
	// (all the examples pass zero)
	
	NSString *queryTemplate = @"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><query><statement>%@</statement><pageSize>%d</pageSize></query>";
	NSString *query = [[NSString alloc] initWithFormat:queryTemplate, cql, kMaxSearchResults];
	self.postData = query;
	NSLog(@"sending query: %@", query);
	[query release];
	
	return (CMISQueryDownload *) [self initWithURL:u delegate:del];
}

// this is identical to the non-CMIS version
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
	
	// create an array to hold the folder items
	NSMutableArray *r = [[NSMutableArray alloc] init];
	self.results = r;
	[r release];
	
	// create a parser and parse the xml
	NSXMLParser *parser = [[NSXMLParser alloc] initWithData:self.data];
	[parser setDelegate:self];
	[parser parse];
	[parser release];
	
	// if the user has selected the preference to hide "dot" files, then filter those from the list
	if (!userPrefShowHiddenFiles()) {
		for (int i = [self.results count] - 1; i >= 0; i--) {
			SearchResult *item = [self.results objectAtIndex:i];
			if ([item.title hasPrefix:@"."]) {
				[self.results removeObjectAtIndex:i];
			}
		}
	}
	
	[super connectionDidFinishLoading:connection];
}

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
	
	// if this is a new entry, create a repository item and add it to the list
	if ([elementName isEqualToString:@"entry"]) {
		SearchResult *r = [[SearchResult alloc] init];
		[self.results addObject:r];
		[r release];
	}
	
	if ([elementName isEqualToString:@"content"]) {
		[[self.results lastObject] setContentLocation: [attributeDict objectForKey:@"src"]];
	}
	
	if ([elementName hasPrefix:@"cmis:property"]) {
		self.currentCMISProperty = [attributeDict objectForKey:@"cmis:name"];
	}
	
	self.elementBeingParsed = elementName;
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
	self.elementBeingParsed = nil;
	if ([elementName hasPrefix:@"cmis:property"]) {
		self.currentCMISProperty = nil;
	}
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
	SearchResult *currentItem = [self.results lastObject];
	
	if ([self.elementBeingParsed isEqualToString:@"title"]) {
		currentItem.title = currentItem.title ? [currentItem.title stringByAppendingString:string] : string;
	}
	else if ([self.currentCMISProperty isEqualToString:@"Relevance"] && [self.elementBeingParsed isEqualToString:@"cmis:value"]) {
		currentItem.relevance = currentItem.relevance ? [currentItem.relevance stringByAppendingString:string] : string;
	}
}

- (void) start {
	// create a post request
	NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];
	NSData *d = [self.postData dataUsingEncoding:NSUTF8StringEncoding];
	NSString *len = [[NSString alloc] initWithFormat:@"%d", [d length]];
	[requestObj addValue:len forHTTPHeaderField:@"Content-length"];
	[requestObj addValue:@"application/cmisquery+xml" forHTTPHeaderField:@"Content-Type"];
	[requestObj setHTTPMethod:@"POST"];
	[requestObj setHTTPBody:d];
	[len release];
	
	[NSURLConnection connectionWithRequest:requestObj delegate:self];
	
	// start the "network activity" spinner 
	startSpinner();
}

@end

/*
 
 sample response
 
 <?xml version="1.0" encoding="UTF-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
 <author><name>mmuller</name></author>
 <generator version="3.2.0 (2039)">Alfresco (Community)</generator>
 <icon>http://cm.ziaconsulting.com:80/alfresco/images/logo/AlfrescoLogo16.ico</icon>
 <id>urn:uuid:resultset</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/query"/>
 <link rel="first" href="http://cm.ziaconsulting.com:80/alfresco/service/api/query?maxItems=100&amp;skipCount=0&amp;guest=" type="application/atom+xml;type=feed"/>
 <title>Result set for SELECT score() as Relevance, ContentStreamLength FROM Document where contains('Muller')</title>
 <updated>2009-10-28T20:38:01.182Z</updated>
 <entry>
 <author><name>mmahon</name></author>
 <content type="application/vnd.excel" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/content.xls"/>
 <id>urn:uuid:986b162e-0867-4a7b-9f4f-0e3837cdc97b</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b"/>
 <link rel="enclosure" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/content.xls"/><link rel="edit-media" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/content.xls"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/versions"/>
 <link rel="stream" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b/content.xls"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>WBS-django-conversion.xls</title>
 <updated>2009-06-15T22:06:23.037Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0256947092711926</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>18944</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/xls.gif</alf:icon>
 </entry>
 <entry>
 <author><name>mmahon</name></author>
 <content type="application/vnd.excel" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/content.xls"/>
 <id>urn:uuid:1534964d-5924-4a20-9764-81d2e7f4beb4</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4"/>
 <link rel="enclosure" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/content.xls"/><link rel="edit-media" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/content.xls"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/versions"/>
 <link rel="stream" type="application/vnd.excel" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/1534964d-5924-4a20-9764-81d2e7f4beb4/content.xls"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>Cost Spreadsheet.xls</title>
 <updated>2009-06-15T22:05:37.731Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0114834867417812</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>25088</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/xls.gif</alf:icon>
 </entry>
 <entry>
 <author><name>mmahon</name></author>
 <content type="application/msword" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/content.doc"/>
 <id>urn:uuid:4cf3b9de-e492-4374-b0c5-b9a48661b011</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011"/>
 <link rel="enclosure" type="application/msword" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/content.doc"/><link rel="edit-media" type="application/msword" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/content.doc"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/versions"/>
 <link rel="stream" type="application/msword" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4cf3b9de-e492-4374-b0c5-b9a48661b011/content.doc"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>mmuller_bio.doc</title>
 <updated>2009-07-02T18:04:26.134Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0094533115625381</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>55808</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/doc.gif</alf:icon>
 </entry>
 <entry>
 <author><name>pjh</name></author>
 <content type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/content.xlsx"/>
 <id>urn:uuid:395020f4-31d8-4554-b511-bc381907ee84</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84"/>
 <link rel="enclosure" type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/content.xlsx"/><link rel="edit-media" type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/content.xlsx"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/versions"/>
 <link rel="stream" type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/395020f4-31d8-4554-b511-bc381907ee84/content.xlsx"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>zia_resource_planning.xlsx</title>
 <updated>2009-10-06T22:09:14.134Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0074231373146176</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>14998</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/xlsx.gif</alf:icon>
 </entry>
 <entry>
 <author><name>mmahon</name></author>
 <content type="text/xml" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/content.xml"/>
 <id>urn:uuid:4a5f606c-becf-465d-a46f-34a0d0fe1419</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419"/>
 <link rel="enclosure" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/content.xml"/><link rel="edit-media" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/content.xml"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/versions"/>
 <link rel="stream" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/4a5f606c-becf-465d-a46f-34a0d0fe1419/content.xml"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>contents.xml</title>
 <updated>2009-06-15T22:05:56.686Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0031090159900486</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>37377</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/xml.gif</alf:icon>
 </entry>
 <entry>
 <author><name>mmahon</name></author>
 <content type="text/xml" src="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/content.xml"/>
 <id>urn:uuid:8af6d686-c184-46d8-8a3c-a0deca5e7d53</id>
 <link rel="self" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53"/>
 <link rel="edit" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53"/>
 <link rel="enclosure" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/content.xml"/><link rel="edit-media" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/content.xml"/><link rel="allowableactions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/permissions"/>
 <link rel="relationships" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/rels"/>
 <link rel="parents" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/parents"/>
 <link rel="allversions" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/versions"/>
 <link rel="stream" type="text/xml" href="http://cm.ziaconsulting.com:80/alfresco/service/api/node/workspace/SpacesStore/8af6d686-c184-46d8-8a3c-a0deca5e7d53/content.xml"/><link rel="type" href="http://cm.ziaconsulting.com:80/alfresco/service/api/type/document"/>
 <link rel="repository" href="http://cm.ziaconsulting.com:80/alfresco/service/api/repository"/>
 <title>GroundswellTech-Production_Conversion.xml</title>
 <updated>2009-06-15T22:06:15.936Z</updated>
 <cmis:object>
 <cmis:properties>
 <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString>
 <cmis:propertyDecimal cmis:name="Relevance"><cmis:value>0.0026014724280685</cmis:value></cmis:propertyDecimal>
 <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>249831</cmis:value></cmis:propertyInteger>
 </cmis:properties>
 </cmis:object>
 <cmis:terminator/>
 <alf:icon>http://cm.ziaconsulting.com:80/alfresco/images/filetypes/xml.gif</alf:icon>
 </entry>
 <cmis:hasMoreItems>false</cmis:hasMoreItems>
 <opensearch:totalResults>6</opensearch:totalResults>
 <opensearch:startIndex>0</opensearch:startIndex>
 <opensearch:itemsPerPage>100</opensearch:itemsPerPage>
 </feed>
 
 */
